import { createStore, applyMiddleware } from 'redux';
import { routerMiddleware } from '../connected-react-router';
import rootReducer from './reducers';
import history from '../history';

// routerMiddleware中间件，重写dispatch方法，如果发现是router，则保存最新路由信息
const store = applyMiddleware(routerMiddleware(history))(createStore)(rootReducer);

export default store;